T=36
T1=35
T2=35


time <- seq(1,T,1)                
# standardize the variable
stdT <- (time-mean(time))/sd(time)

# index record
y=c(0, 0, 1092.23, 1100.01, 1234.32, 1460.85, 1570.38, 1819.79, 1391.27, 1507.60,
    1541.44, 1631.21, 1628.60, 1609.33, 1801.68, 1809.08, 1754.74, 1779.48, 1699.13,
    1681.39, 1610.46, 1918.45, 1717.07, 1415.69, 1229.02, 1082.02, 1096.61, 1045.84,
    1137.03, 981.1, 647.67, 992.65, 968.62, 926.83, 952.96, 865.64)

# frost days 
f=c(0.1922, 0.3082, 0.3082, -0.9676, 0.5401, 0.3082, 1.1995, 0.1921, -0.8526,
    -1.0835, -0.6196, -1.1995, -0.5037, -0.1557, 0.0762, 2.628, -0.3877, -0.968,
    1.9318, -0.6196, -0.3877, 1.700, 2.2797, 0.6561, -0.8516, -1.0835, -1.0835,
    0.1922, 0.1922, -0.1557, -0.5037, -0.8516, 0.8880, -0.0398, -1.1995, 0)

# recovery data
m=matrix(c(
    13,4,1,2,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1124,
    0,16,4,3,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1259,
    0,0,11,1,1,1,0,2,1,1,1,1,2,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1082,
    0,0,0,10,4,2,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1595,
    0,0,0,0,11,1,5,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1596,
    0,0,0,0,0,9,5,4,0,2,2,2,1,2,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2091,
    0,0,0,0,0,0,11,9,4,3,1,1,1,3,2,2,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,4334),
    nrow=35,ncol=36,byrow=T)

 
# Calculate the no. of birds released each year
rel <- array(0,T1)
for(t in 1:T1){
   rel[t] <- sum(m[t,])
}


data <-list(T=T, T1=T1, T2=T2, y=y, f=f, m=m, rel=rel, stdT=stdT)
# data <-list(T=T, T1=T1, T2=T2, y=y, f=f, m=m, stdT=stdT)
